<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCreditTrainingTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('credit_training', function (Blueprint $table) {
//            $table->comment('学分培训');
            $table->bigInteger('id', true);
            $table->bigInteger('data_version_id')->nullable()->comment('dataVersionId');
            $table->bigInteger('user_id')->nullable()->comment('userId数据');
            $table->string('type', 255)->nullable()->comment('类型 ： 市 CITY / 区 DISTRICT');
            $table->string('course_name', 255)->nullable()->comment('课程名称');
            $table->string('course_model', 255)->nullable()->comment('课程模块');
            $table->string('course_level', 255)->nullable()->comment('课程级别');
            $table->double('course_credit', null, 0)->nullable()->comment('获得学分');
            $table->date('date_time')->nullable()->comment('日期');
            $table->string('class_name', 255)->nullable()->comment('班级名称');
            $table->bigInteger('form_instance_id')->nullable()->comment('formInstanceId');
            $table->dateTime('created_at')->nullable()->useCurrent();
            $table->dateTime('updated_at')->nullable()->useCurrent();
            $table->bigInteger('creator_id')->nullable();
            $table->bigInteger('updater_id')->nullable();
            $table->integer('deleted')->nullable()->default(0)->comment('是否被删除');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('credit_training');
    }
};
